"use client";
import { AreaChart } from "@/components/ui/charts";
import { EmptyState } from "@/components/ui/states";
import { fmtCompact, fmtMw } from "@/lib/format";
/**
* Facilities by opening year (cumulative). Known MW is charted separately (own axis) only when the
* market publishes any MW figure — never on a dual axis.
*/
export function GrowthChart({ data }: { data: Array<{ year: number; facilities: number; knownMw: number | null }> }) {
const pts = [...data].filter((d) => Number.isFinite(d.year)).sort((a, b) => a.year - b.year);
if (pts.length < 2) return